package com.songshuai.webapi.baseapi.enumerations;

public enum FollowStatusEnum {



    WaitFollow(6005001, "待跟进"),
    Following(6005002, "跟进中"),
    HasBookClass(6005003, "已约课"),
    UnAttend(6005004, "约课未出席"),
    Attend(6005005, "已体验"),
    Invalid(6005006, "已失效"),
    Undistributed(6005007, "未分配");

    private int code;
    private String msg;

    FollowStatusEnum(int code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public static int getCode(String define){
        try {
            return FollowStatusEnum.valueOf(define).code;
        } catch (IllegalArgumentException e) {
            return 0;
        }
    }

    public static String getMsg(String define){
        try {
            return FollowStatusEnum.valueOf(define).msg;
        } catch (IllegalArgumentException e) {
            return "";
        }
    }

    public static String getMsg(Integer code){
        if(code==null||code<=0)
            return "";
        for(FollowStatusEnum err : FollowStatusEnum.values()){
            if(err.code==code){
                return err.msg;
            }
        }
        return "";
    }

    public int getCode(){
        return code;
    }

    public String getMsg(){
        return msg;
    }
}
